package hottargui.view;

import hottargui.framework.*;

import minidraw.standard.*;
import minidraw.framework.*;

import java.awt.event.*;

/** A tool to turn the upper card on the tribe card stack.

    Author: Henrik B�rbak Christensen

 */

public class TurnTribeCardTool extends AbstractTool {
	Game game;
	public TurnTribeCardTool(DrawingEditor editor, Game game) {
		super(editor);
		this.game = game;
	}
	public void mouseDown(MouseEvent evt, int x, int y) { 
		// Både CF og SEV kom uafhængigt af hinanden i tanke om denne forbedring :-)
		Drawing model = editor().drawing();
		Figure figureUnderCursor = model.findFigure(x, y);
		if ( figureUnderCursor instanceof CardFigure)
		{
			game.turnCard();
		}
	}
}
